﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Meeting.Public;
namespace Meeting.Web.Admin.MeetingSet
{
    /// <summary>
    /// MeetingFiles 的摘要说明
    /// </summary>
    public class MeetingFiles : IHttpHandler
    {
        string MethodName = "";
        int nPageIndex = 1;
        int nPageSize = 4;
        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            context.Response.ContentType = "application/json;charset=utf-8";
            MethodName = context.Request.Params["method"];
            nPageIndex = CommonFunction.varToIntDef(context.Request.Params["page"], 1);
            nPageSize = CommonFunction.varToIntDef(context.Request.Params["rows"], 15);
            switch (MethodName.ToLower())
            {
                case "getmeetingfiles":
                    context.Response.Write(GetMeetingFiles(context));
                    break;
                case "add":
                    //context.Response.Write(SavaData(context));
                    break;
                case "delete":
                    //context.Response.Write(DeleteData(context));
                    break;
            }

        }

        private string GetMeetingFiles(HttpContext context)
        {
            //throw new NotImplementedException();
            string keyword = context.Request.Params["MeetingId"];

            string sF = " 1=1 ";
            if (!string.IsNullOrEmpty(keyword)) sF += " And MeetingId = '" + keyword + "' ";
            BLL.MeetingFiles rss = new BLL.MeetingFiles();
            return rss.GetMeetingFiles(nPageIndex, nPageSize, sF);

        }


        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}